<#include "/layout/layout.ftl">
<#import "/layout/macro.ftl" as macro>
<#assign css>
	<link rel="stylesheet" href="/assets/vendor/bootstrap-datepicker/css/bootstrap-datepicker3.css">
	<style>
</style>
</#assign>
<#assign js>
	<script src="/assets/vendor/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
	<script type="text/javascript" src="/assets/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js" charset="UTF-8"></script>
<script>

	//tableId,queryId,conditionContainer
	//var userTable;
	var winId="userWin";
	$(function() {
		//init table and fill data
		//userTable = new CommonTable("user_table", "user_list", "searchDiv");

		//button event
		//form_init();
		//Date picker
		$('#datepicker').datepicker({
			autoclose: true,
			format:"yyyy-mm-dd",
			todayHighlight:true,
			language:"zh-CN"
		});
		$('#datepicker-end').datepicker({
			autoclose: true,
			format:"yyyy-mm-dd",
			todayHighlight:true,
			language:"zh-CN"
		});
		$('#datepicker').unbind("change");
		$('#datepicker').change(function(){
			$('#datepicker-end').datepicker('setStartDate', $("#datepicker").val());
		});
		$('#datepicker-end').unbind("change");
		$('#datepicker-end').change(function(){
			$('#datepicker').datepicker('setEndDate', $("#datepicker-end").val());
		});
	});
</script>
</#assign>
<@layout title="师傅状态日志" active="master">
<!-- Content Header (Page header) -->

<!-- Main content -->
<section class="content">
	<!-- Default box -->
	<div class="box box-primary">
	<div class="box-header">
		<form class="form-horizontal form-edit" method="post" action="/master/history/${userId}" id="form">
			<div class="col-sm-2">
			<div class="input-group date">
				<div class="input-group-addon">
					<i class="fa fa-calendar"></i>
				</div>
				<input type="text" placeholder="开始日期" name="startDate" class="form-control pull-right" id="datepicker" value="${(historyReq.startDate)!}">
			</div>
			</div>
			<div class="col-sm-2">
			<div class="input-group date">
				<div class="input-group-addon">
					<i class="fa fa-calendar"></i>
				</div>
				<input type="text" placeholder="结束日期" name="endDate" class="form-control pull-right" id="datepicker-end" value="${(historyReq.endDate)!}">
			</div>
			</div>
			<div class="btn-group">
				<button type="submit" class="btn btn-primary" data-btn-type="search">查询</button>
				<button type="button" class="btn btn-default" data-btn-type="reset" onclick="javascript:$('#form')[0].reset();">重置</button>
			</div>
		</form>
	</div>
		<div class="box-body">
			<table class="table table-striped">
				<tr>
					<th>时间</th>
					<th>时长</th>
					<th>日志</th>
				</tr>
                <#list pageInfo.list as item>
                <tr>
					<td >${item.historyDate!}</td>
					<td >${item.times!}</td>
					<td>
					<@shiro.hasPermission name="system:master:detail">
						<a class="btn btn-sm btn-primary" href="/master/online/${item.ids!}/${item.userId!}" data-btn-type="detail">在线状态日志</a>
					</@shiro.hasPermission>
					</td>
				</tr>
                </#list>
			</table>
		</div>
		<!-- /.box-body -->
		<div class="box-footer clearfix">
            <@macro.page pageInfo=pageInfo url="/master/history?" />
		</div>
	</div>
	<div class="box-footer">
		<button type="button" class="btn btn-default btn-back">返回</button>
	</div>
	<!-- /.box -->

</section>
<!-- /.content -->
</@layout>
